package com.huaxin.common.utils;

import android.view.View;

/**
 * Created by Administrator on 2017/3/2.
 */

public class SDKBug {

    /**Android view更改背景资源，padding消失的问题 在4.4版本有发现此bug
     *
     * @param view
     * @param resId
     */
    public static void setBackgroundResourceWithPadding(View view, int resId) {
        int bottom = view.getPaddingBottom();
        int top = view.getPaddingTop();
        int right = view.getPaddingRight();
        int left = view.getPaddingLeft();
        view.setBackgroundResource(resId);
        view.setPadding(left, top, right, bottom);
    }
}
